package org.bling.star.server.connect;

import org.bling.star.common.connect.CommandStreamKey;
import org.bling.star.common.connect.ConnectClient;
import io.netty.channel.Channel;

/**
 * 连接池
 */
public interface StreamPool {

    /**
     * 更新连接状态
     * @param connection
     * @return
     */
    boolean refresh(ConnectClient connection);

    /**
     * 表示断开连接
     * @param connection
     * @return
     */
    boolean disconnect(ConnectClient connection);

    /**
     * 添加连接
     */
    Boolean connect(ConnectClient connection);
    /**
     * 添加连接
     */
    ConnectClient connect(Channel channel);

    /**
     * 关闭
     * @return
     */
    boolean shutdown();

    /**
     * 广播
     */
    Boolean broadcast(String message , ConnectClient connect);
    /**
     * 获取聊天室名称
     * @return
     */
    String getStreamName();

    Boolean remove(ConnectClient connectClient);

    CommandStreamKey getStreamSecretKey();

}
